#include "FileDirSelect.h"

#include <QDebug>

FileDirSelect::FileDirSelect(bool fileShow)
{
	QString labelText = "";
	setFileMode(QFileDialog::ExistingFile);
	setAcceptMode(QFileDialog::AcceptOpen);
	connect(this, SIGNAL(fileSelected(QString)), SLOT(OnSelected(QString)));
	connect(this, SIGNAL(accepted()), SLOT(OnAccepted()));
	if (!fileShow)
	{
		labelText = "Choose directory";
		setOptions(QFileDialog::ShowDirsOnly);
	}
	else
	{
		labelText = "Choose file";
		//fileShow...?
	}
//	setLabelText(labelText);
}

void FileDirSelect::OnSelected(QString path)
{

}

void FileDirSelect::OnAccepted()
{
	qDebug() << "OnAccepted";
}
